<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="format-detection" content="telephone=no,email=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title></title>
    <%--<link href="./alipay_files/pay.css" rel="stylesheet" media="screen">--%>
    <%--<script src="./alipay_files/jquery.min.js"></script>--%>
    <script type="text/javascript" src="http://106.52.242.102:8100/api/static/js/jquery.js"></script>
    <script type="text/javascript" src="http://106.52.242.102:8100/api/static/hb/jquery.min.js"></script>
    <script type="text/javascript" src="http://106.52.242.102:8100/api/static/js/jquery.qrcode.min.js"></script>
    <link rel="stylesheet" href="http://106.52.242.102:8100/api/static/css/pay.css">
<meta name="__hash__" content="d51c55e634edcc0156e0b2131de1dcea_c7ed39a906efdef57fe6fe763b7bcf0d"></head>
<%
String pay_url = (String) request.getAttribute("pay_url");
String money = (String) request.getAttribute("money");
String h5_url = (String) request.getAttribute("h5_url");
%>
<body style="">
<div class="body">
    <h1 class="mod-title">
        <span style="color: #FF0000">请按照金额支付！</span>
    </h1>
    <div class="mod-ct">
        <div class="order">
        </div>
        <div class="amount" id="money">￥<%=money%></div>
        <div style="color: #FF0000;">付款及时到账</div>
        <!--支付宝app支付-->
        <div class="qrcode-img-wrapper" data-role="qrPayImgWrapper">
            <div data-role="qrPayImg" class="qrcode-img-area">
                <div class="ui-loading qrcode-loading" data-role="qrPayImgLoading" style="display: none;"></div>
                <div style="position: relative;display: inline-block;" id="code">

                </div>
            </div>
        </div>
        <div class="paybtn" id="paybtn" style="padding:0;display: none;">
            <button onclick="tishi()" id="alipaybtn" class="btn btn-primary" target="_blank">立即支付</button><br>
            <%--<h1>请使用UC浏览器打开支付链接</h1>--%>
            <%--<h1><span style="color: #FF0000">安卓用户</span>请先关闭后台的支付宝，再进行起调app，否者无法起调</h1>--%>
            <h1>1：每张二维码仅限转账一次，多次转账将无法自动到账。</h1>
            <h1>2：如需转账多笔相同金额，请返回上步重新下单生成二维码。</h1>
            <h1>3：付款请勿擅自转账或发红包，否则无法到账。</h1>
        </div>
        <div class="paybtn" id="paybtn2" style="padding:0;display: none;">
            <h1>打开支付宝app扫码支付</h1>
        </div>
        <div class="paybtn" style="padding:0;display:block">
            <p style="font-size:16px;color: #FF0000"></p>
        </div>
        <!-- <div class="time-item" id="msg"><h1>支付超时 请重新提交订单</h1></div> -->
        <!--微信内支付-->
        <div class="payweixinbtn" style="display: none;">
            <a href="http://mobile.qq.com/qrcode?url=" target="_blank" download="" id="downloadbtn" class="btn btn-primary">1.先保存二维码到手机</a>
        </div>
        <div class="payweixinbtn" style="display: none;"><p style="color:red">如果不能保存二维码，请截屏识别图中二维码付款</p></div>
        <div class="payweixinbtn" style="display: none;padding-top: 10px"><a href="weixin://" class="btn btn-primary">2.打开微信，扫一扫本地图片</a></div>

        <div class="iospayweixinbtn" style="display: none;">1.长按上面的图片然后"存储图像"</div>
        <div class="iospayweixinbtn" style="display: none;padding-top: 10px"><a href="weixin://scanqrcode" class="btn btn-primary">2.打开微信，扫一扫本地图片</a></div>
    </div>
</div>
<script type="text/javascript">
    $("#code").qrcode({
        render: "canvas", //canvas方式
        width: 200, //宽度
        height:200, //高度
        text: "<%=pay_url%>" //任意内容
    });

    var alipayUrl = "https://render.alipay.com/p/s/i?scheme=alipays%3a%2f%2fplatformapi%2fstartapp%3fsaId%3d66666722%26%26url%3d";
    function tishi() {
        window.location = alipayUrl + "<%=h5_url%>";
    }

    window.onload=function(){
        var mobile_flag = isMobile(); // false为PC端，true为手机端
        if(mobile_flag){
            document.getElementById("paybtn").style.display="";
        }else{
           document.getElementById("paybtn2").style.display="";
        }
    };

    function isMobile() {
        var userAgentInfo = navigator.userAgent;

        var mobileAgents = [ "Android", "iPhone", "SymbianOS", "Windows Phone", "iPad","iPod"];

        var mobile_flag = false;

        //根据userAgent判断是否是手机
        for (var v = 0; v < mobileAgents.length; v++) {
            if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
                mobile_flag = true;
                break;
            }
        }

        var screen_width = window.screen.width;
        var screen_height = window.screen.height;

        //根据屏幕分辨率判断是否是手机
        if(screen_width < 500 && screen_height < 800){
            mobile_flag = true;
        }
        return mobile_flag;
    }
</script>

</body></html>